<template>
  <div class="apps">
    <h2>这里是App组件</h2>
    <h2>app中的数据{{ name }}:{{ age }}</h2>
    <Son/>
  </div>
</template>

<script>
import {reactive, toRefs, provide} from 'vue';
import Son from "@/components/Son";

export default {
  name: 'App',
  components: {Son},
  setup() {
    let person = reactive({
      name: '张三',
      age: 22
    });
    provide('persons', person);
    return {
      ...toRefs(person)
    };
  }
}
</script>

<style>
.apps {
  background-color: #42b983;
  padding: 10px;
}
</style>
